package com.angel.mocks.data.generator.dataGenerator;

import java.io.FileNotFoundException;
import java.io.InputStream;

import com.angel.data.generator.annotations.Generator;
import com.angel.data.generator.annotations.importFileProcessorRunner.ImportFileProcessorRunnerBuilder;
import com.angel.data.generator.annotations.inputStream.InputStreamBuilder;
import com.angel.data.generator.exceptions.DataGeneratorException;
import com.angel.io.descriptor.FileProcessorDescriptor;
import com.angel.io.processors.commands.impl.ExcelFileProcessorCommand;
import com.angel.io.processors.runners.imports.impl.ImportFileProcessorRunner;
import com.angel.mocks.io.Hotel;
import com.angel.mocks.io.resourceLocation.ResourceLocation;

/**
 *
 * @author William
 */
@Generator
	(
		dependencies = { },
		pages = {1,2},
		daoName = "addressDAO",
		objectClass = Hotel.class
	)
public class ExampleInvalidImportFileMethodAnnotationDataGenerator {

    private static final long serialVersionUID = 456392726459660147L;

    @ImportFileProcessorRunnerBuilder(fileProcessorDescriptor = FileProcessorDescriptor.class, name = "Rooms File")
    public ImportFileProcessorRunner prepareImportFileProcessorRunner(ExcelFileProcessorCommand fileProcessorDescriptor) {
    	/** Method shouldn't execute because parameter it invalid. */
        return null;
    }

    @InputStreamBuilder
    public InputStream prepareInputStream() {
        try {
            return ResourceLocation.findInputStreamFor(ResourceLocation.HOTELES_EXCEL_FILE);
        } catch (FileNotFoundException e) {
            throw new DataGeneratorException("File not found [" + ResourceLocation.HOTELES_EXCEL_FILE + "].", e);
        }
    }
}